//
//  BTAVPlayerView.m
//  BTAVEditor
//
//  Created by TMAC on 2020/1/9.
//  Copyright © 2020 XMac. All rights reserved.
//

#import "BTAVPlayerView.h"

@interface BTAVPlayerView ()

@end

@implementation BTAVPlayerView

+(Class)layerClass{
    return [AVPlayerLayer class];
}

-(void)setPlayer:(AVPlayer *)player{
    ((AVPlayerLayer *)self.layer).player = player;
}

-(AVPlayer *)player{
    return [(AVPlayerLayer *)self.layer player];
}

-(void)play{
    [self.player play];
}

-(void)pause{
    [self.player pause];
}

-(void)next:(AVPlayerItem *)item{
    //todo 添加动画
    [self.player replaceCurrentItemWithPlayerItem:item];
}

-(void)previous:(AVPlayerItem *)item{
    //todo 添加动画
    [self.player replaceCurrentItemWithPlayerItem:item];
}



@end
